home *** CD-ROM | disk | FTP | other *** search
/ Softwarová Záchrana 3 / Softwarova-zachrana-3.bin / Xteq X-Setup / xqdcXSP-Setup-EN.exe / {app} / plugins / XQ WinXP AutoPlay 6.xpl < prev    next >
Text File  |  2004-03-03  |  7KB  |  140 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 5.0"
  2. "TYPE"="1"
  3. "COUNT"="4"
  4. "UIPATH"="System\AutoPlay\Custom Handlers"
  5. "NAME"="Custom Handler #2"
  6. "OSVERSION"="0000011"
  7. "VERSION"="1.05"
  8. "LANGUAGE"="VBScript"
  9. ---"TEXT 1"="Menu Text"
  10. "TEXT 1"="Action Text"
  11. "TEXT 2"="Provider Text"
  12. "TEXT 3"="Command"
  13. "TEXT 4"="Icon"
  14. "DESCRIPTION 1"="When Windows detects a CD-ROM (or any other media) which does not contain an AUTORUN.INF normally needed for AutoPlay, Windows will check if there are any "handlers" available that can "handle" the contents of the CD-ROM. 
  15. "DESCRIPTION 2"="For example, when you insert a Video-CD usually does not contain an AUTORUN.INF, Windows will check if there is one or more handlers registered to handle this Video-CD. If so, a window will pop up displaying the registered handlers so you can easily choose one. You can also select one of these handlers as the default selection for the current type of CD-ROM.
  16. "DESCRIPTION 3"="Windows out-of-the-box does only include the Windows Media Player as "handler" for Video-CDs. With this plug-in, you could easily define your favorite video player as your "Customer Handler #1" and later on assign this Custom Handler to Video-CDs (see folder "Handler Assignment"). 
  17. "DESCRIPTION 4"="Next time you insert a Video-CD, Window will not only display the default "Show Video using Windows Media Player" but also your own "Show Video using My Favorite Player". 
  18. "DESCRIPTION 5"="To define your own Handler, first insert an Action Text and the Provider Text. This will later on appear inside the AutoPlay window as ┤Action Text` with `Provider Text`. For example, 'Show this Video-CD' as action text and `Super-Duper VCD Player` as Provider Text would read `Show this Video-CD using Super Duper VCD Player` inside the AutoPlay window. 
  19. "DESCRIPTION 6"="The field "Command" tells Windows where to find the program that should be executed, for example "C:\Program Files\Super Duper\player.exe". The currently selected drive can be inserted with "%1", for example "C:\ player.exe %1" would result in the executed command "C:\ player.exe E:\" if E:\ is the drive containing the CD.
  20. "DESCRIPTION 7"=""Icon" is the icon that should be displayed inside the AutoPlay window. The easiest way is to simply supply the command again, appended by ",0" to tell Windows to use the first icon. For example "C:\ player.exe,0" would result in the first icon of player.exe to be displayed. 
  21. "DESCRIPTION 8"="IMPORTANT: You must first assign this custom handler to a CD type before it will show up! Simply defining it here will not make it appear. Please see the folder "Handler Assignment".
  22. "AUTHOR"="Xteq Systems"
  23. "CONTACTURL"="http://www.xteq.com"
  24. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  25. "COMMENT 1"="Thanks to Matthias Mei▀er [digi_c@web.de] for the idea."
  26. "COMMENT 2"="Thanks to IssaMe for the bug notice!"
  27.  
  28. '***** MAIN FILE !!!!! ******
  29. sNameMain="X-Setup_AutoPlay_CustomHandler2"
  30. '***** THIS IS A ORIGINAL FILE ******
  31.  
  32.  
  33. '*** OTHER CONST ***
  34. sMenu_Path_1="HKLM\Software\Classes\" & sNameMain & "\"
  35. sMenu_Path_2=sMenu_Path_1 & "shell\"
  36. sMenu_Path_3=sMenu_Path_2 & "open\"
  37. sMenu_Path_4=sMenu_Path_3 & "@"
  38. sMenu_Path_5=sMenu_Path_3 & "command\"
  39. sMenu_Path_6=sMenu_Path_5 & "@"
  40.  
  41. sHandler_Path1="HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\" & sNameMain & "\"
  42. 'sHandler_Path2=sHandler_Path1 & "Action String"
  43. sHandler_Path2=sHandler_Path1 & "Action"
  44. sHandler_Path3=sHandler_Path1 & "Provider"
  45. sHandler_Path5=sHandler_Path1 & "DefaultIcon"
  46.  
  47. sHandler_Path6=sHandler_Path1 & "InvokeProgID"
  48. sHandler_Path7=sHandler_Path1 & "InvokeVerb"
  49.  
  50. Sub Plugin_Initialize
  51. ' s=RegReadValue(sMenu_Path_4)
  52. ' SetUIElement 1,s
  53.  
  54.  s=RegReadValue(sHandler_Path2)
  55.  SetUIElement 1,s
  56.  
  57.  s=RegReadValue(sHandler_Path3)
  58.  SetUIElement 2,s
  59.  
  60.  s=RegReadValue(sMenu_Path_6)
  61.  SetUIElement 3,s
  62.  
  63.  s=RegReadValue(sHandler_Path5)
  64.  SetUIElement 4,s
  65. End Sub
  66.  
  67. Sub Plugin_CheckData(ElementIndex)
  68. End Sub
  69.  
  70. Sub Plugin_Apply(ElementIndex,ElementSubIndex)
  71.  ''sMenuText=GetUIElement(1)
  72.  sMenuText=GetUIElement(1)
  73.  
  74.  sActionText=GetUIElement(1)
  75.  sProvText=GetUIElement(2)
  76.  sCmd=GetUIElement(3)
  77.  sIcon=GetUIElement(4)
  78.  
  79.  bAllFilled=false
  80.  if len(sMenuText)>0 and len(sActionText)>0 and len(sProvText)>0 and len(sCmd)>0 then
  81.     bAllFilled=true
  82.  end if
  83.  
  84.  bSomeMissing=false
  85.  if len(sMenuText)=0 or len(sActionText)=0 or len(sProvText)=0 or len(sCmd)=0 then
  86.     bSomeMissing=true
  87.  end if
  88.  
  89.  bAllMissing=false
  90.  if len(sMenuText)=0 and len(sActionText)=0 and len(sProvText)=0 and len(sCmd)=0 and len(sIcon)=0 then
  91.     bAllMissing=true
  92.  end if
  93.  
  94.  
  95.  
  96.  if bAllMissing=true then 'delete all
  97.     If RegPathExists(sMenu_Path_5) then Call RegDeletePath(sMenu_Path_5)
  98.     If RegPathExists(sMenu_Path_3) then Call RegDeletePath(sMenu_Path_3)
  99.     If RegPathExists(sMenu_Path_2) then Call RegDeletePath(sMenu_Path_2)
  100.     If RegPathExists(sMenu_Path_1) then Call RegDeletePath(sMenu_Path_1)
  101.  
  102.     if RegValueExists(sHandler_Path7) then Call RegDeleteValue(sHandler_Path7)     
  103.     if RegValueExists(sHandler_Path6) then Call RegDeleteValue(sHandler_Path6)     
  104.     if RegValueExists(sHandler_Path5) then Call RegDeleteValue(sHandler_Path5)
  105. '''    if RegValueExists(sHandler_Path4) then Call RegDeleteValue(sHandler_Path4)     
  106.     if RegValueExists(sHandler_Path3) then Call RegDeleteValue(sHandler_Path3)     
  107.     if RegValueExists(sHandler_Path2) then Call RegDeleteValue(sHandler_Path2)     
  108.     if RegPathExists(sHandler_Path1) then Call RegDeletePath(sHandler_Path1)     
  109.          
  110.  
  111.  else
  112.     if bAllFilled=true then 'set all
  113.        Call RegWriteValue(sMenu_Path_4,sMenutext,1)
  114.        Call RegWriteValue(sMenu_Path_6,sCmd,1)
  115.        Call RegWriteValue(sHandler_Path2,sActionText,1)
  116.        Call RegWriteValue(sHandler_Path3,sProvText,1)
  117.        Call RegWriteValue(sMenu_Path_6,sCmd,1)
  118.        if len(sIcon)>0 then 
  119.           Call RegWriteValue(sHandler_Path5,sIcon,1)
  120.        else 
  121.           If RegValueExists(sHandler_Path5) then Call RegDeleteValue(sHandler_Path5)
  122.        end if
  123.  
  124.        Call RegWriteValue(sHandler_Path6,sNameMain,1)
  125.        Call RegWriteValue(sHandler_Path7,"open",1)
  126.  
  127.        Call MsgInformation("Your custom handler has been added. Please notice that you need to assign it (see folder ┤Handler Assignment┤) before it will appear inside the AutoPlay list.") 
  128.      else
  129.        if bSomeMissing=true then
  130.           Call MsgError("Please fill out all fields (icon may be left blank) to add a custom item or clear all fields to remove it.")
  131.        end if
  132.     end if
  133.  end if
  134.  
  135.  
  136. End Sub
  137.  
  138. Sub Plugin_Terminate 
  139. End Sub
  140.